import request from '@/utils/request'

// 查询猪信息
export function listPig(query) {
    return request({
        url: '/archives/dpig',
        method: 'get',
        params: query,
    })
}

// 删除猪信息
export function delPig(pigId) {
    return request({
        url: '/archives/dpig/' + pigId,
        method: 'delete'
    })
}

// 新增猪信息
export function addPig(data) {
    return request({
        url: '/archives/dpig/createInfo',
        method: 'post',
        data: data
    })
}

// 新增图片信息
export function addPic(file) {
    return request({
        url: '/file/fileInfo/upload',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data',
        },
        data: file
    })
}
// 修改领养记录
export function updatePig(data) {
    return request({
        url: '/archives/dpig',
        method: 'put',
        data: data
    })
}